package com.techb.model;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

import com.techb.table.UserDTO;
import com.techb.util.connection.ConnectionManager;

public class SubmissionDAO {
	public String InsertMarksData(String rollNo,String [] subj_id,String [] attendance,String [] ct_marks,String [] hall_mcq,String [] hall_cq,String [] hall_total,String [] hall_gtotal)
	{
		   Connection conn = ConnectionManager.getConnection();
		  
		   
		   PreparedStatement stmt = null;
		   ResultSet r = null;
			try
			{
				String sql = "insert into tblmarks(roll_no, subj_id, years,exam,attendent,ct,mcq,cq,hall_total,exam_total)" +
					" values (?, ?, ?,?,?,?,?,?,?,?)";
				PreparedStatement ps = conn.prepareStatement(sql);
				 
				for (int idNo=0;idNo<subj_id.length;idNo++) {
					ps.setString(1, roll_no);
				    ps.setString(2, subj_id[idNo]);
				    ps.setString(3, );
				    ps.addBatch();
				}
				ps.executeBatch();
				ps.close();
				conn.close(); 
			    
			} 
			catch (Exception e){e.printStackTrace();}
	 		finally{try{stmt.close();ConnectionManager.closeConnection(conn);} catch (Exception e)
				{e.printStackTrace();}stmt = null;conn = null;}
		
     		return null;
	}

}
